package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.R;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.model.hosp.Department;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author zhmwi
 * @Date 2021/7/12
 * @Dersciption
 */
@Api("科室管理接口")
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("查询所有科室列表")
    @GetMapping("/getDepartmentList/{hoscode}")
    public R getDepartmentList(@PathVariable("hoscode") String hoscode){
        List<DepartmentVo> deptList = departmentService.getDepartmentList(hoscode);
        return R.ok().data("list" , deptList);
    }
}
